<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style>
    ul{
        margin:0;
        padding:0;
        list-style:none;
    }
    ul:after{
        content:"";
        display:block;
        clear:both;
    }
    li{
        float:left;
        position:relative;
    }
    input{
        width: 180px;
        height: 40px;
    }
    div{
        width: 180px;
        height: 0;
        background-color:red;
        color:#fff;
        /*display:none;*/
        overflow:hidden;
        position:absolute;
        left:0;
        top:40px;
        transition:height 2s;

    }
</style>
<body>
<ul>
    <li>
        <input type="button" value="按钮1">
        <div>导航1的下拉框</div>
    </li>
    <li>
        <input type="button" value="按钮1">
        <div>导航2的下拉框</div>
    </li>
    <li>
        <input type="button" value="按钮1">
        <div>导航3的下拉框</div>
    </li>
</ul>
<script>
    var btn=document.getElementsByTagName("li");
    //    var Div=document.getElementsByTagName("div");
    for(var i=0;i<btn.length;i++){
        btn[i].onmouseover=function(){
            this.getElementsByTagName("div")[0].style.height="300px";
        }
        btn[i].onmouseout=function(){
            this.getElementsByTagName("div")[0].style.height="0";
        }
    }
</script>
</body>
</html>